package IteratorPattern;

/**
 * @version: java version 1.8
 * @Author: Zheng
 * @description:
 * @date: 2022-08-21 20:44
 */
public class IteratorPatternDemo {
    public static void main(String[] args) {
        NameRepository nameRepository=new NameRepository();

        for (Iterator iter = nameRepository.getIterator();iter.hasNext();){
            String name=(String) iter.next();
            System.out.println("Name"+name);
        }
    }
}
